package model

import (
	"time"
)

type VideoRsp struct {
	Url   string `json:"url"`
	Thumb string `json:"thumb"`
	Type  string `json:"type"`
}

// VideoClick 视频观看 点赞 收藏
type VideoClick struct {
	ShortType int `json:"short_type"`
	Id        int `json:"id"`
}
type ShortVideoReq struct {
	Id       int    `json:"id"`
	PageSize int    `json:"pageSize"`
	PageNo   int    `json:"pageNo"`
	UserId   int    `json:"user_id"`
	Type     string `json:"type"`
}
type ShortRsp struct {
	Id            int              `json:"id"`
	UserId        int              `json:"user_id"`
	Type          int              `json:"type"`
	Title         string           `json:"title"`
	Pic           []VideoRsp       `json:"pic"`
	Video         []VideoRsp       `json:"video"`
	BindType      int              `json:"bind_type"`
	BindId        int              `json:"bind_id"`
	Content       string           `json:"content"`
	Kouling       string           `json:"kouling"`
	StoreName     string           `json:"store_name"`
	StoreLocation string           `json:"store_location"`
	StoreTel      string           `json:"store_tel"`
	GatherUrl     string           `json:"gather_url"`
	Dz            int              `json:"dz"`
	Zf            int              `json:"zf"`
	IsFeel        int              `json:"is_feel"`
	TotalAmount   float32          `json:"total_amount"`
	SubMchId      string           `json:"sub_mch_id"`
	Watch         int              `json:"watch"`
	Store         interface{}      `xorm:"-" json:"store"`
	IsDz          int              `xorm:"-" json:"is_dz"`
	IsZf          int              `xorm:"-" json:"is_zf"`
	Goods         *ShortVideoGoods `xorm:"-" json:"goods"`
	VideoStr      string           `xorm:"-" json:"video_str"`
	IsBuy         int              `xorm:"-" json:"is_buy"`
	DeletedAt     time.Time        `xorm:"deleted" json:"-" form:"deleted_at" mapstructure:"deleted_at"`
}
type ShortVideoGoods struct {
	Id       int         `xorm:"pk autoincr 'id'" json:"id"`
	Title    string      `xorm:"title" json:"title"`
	Price    float64     `xorm:"price" json:"price"`
	ShareImg interface{} `xorm:"share_img" json:"share_img"`
}
type Coupon struct {
	Id       int
	Title    string
	Price    float64
	ShareImg interface{}
}
type ShareUser struct {
	Id        int
	FromId    int
	UserId    int
	ShareType int
	State     int
}

func (ShortVideoGoods) TableName() string {
	return "goods"
}
func (ShortRsp) TableName() string {
	return "shortvideo"
}

type ShortVideo struct {
	Id              int       `xorm:"not null pk autoincr INT(10)" json:"id" form:"id" mapstructure:"id"`
	UserId          int       `xorm:"" json:"user_id" form:"user_id" mapstructure:"user_id"`
	Type            int       `xorm:"" json:"type" form:"type" mapstructure:"type"`
	Title           string    `xorm:"" json:"title" form:"title" mapstructure:"title"`
	Pic             string    `xorm:"" json:"pic" form:"pic" mapstructure:"pic"`
	Video           string    `xorm:"" json:"video" form:"video" mapstructure:"video"`
	BindType        int       `xorm:"" json:"bind_type" form:"bind_type" mapstructure:"bind_type"`
	BindId          any       `xorm:"" json:"bind_id" form:"bind_id" mapstructure:"bind_id"`
	Content         string    `xorm:"" json:"content" form:"content" mapstructure:"content"`
	Kouling         string    `xorm:"" json:"kouling" form:"kouling" mapstructure:"kouling"`
	CreatedAt       time.Time `xorm:"created" json:"created_at" form:"created_at" mapstructure:"created_at"`
	UpdatedAt       time.Time `xorm:"updated" json:"updated_at" form:"updated_at" mapstructure:"updated_at"`
	DeletedAt       time.Time `xorm:"deleted" json:"deleted_at" form:"deleted_at" mapstructure:"deleted_at"`
	StoreName       string    `xorm:"" json:"store_name" form:"store_name" mapstructure:"store_name"`
	StoreLocation   string    `xorm:"" json:"store_location" form:"store_location" mapstructure:"store_location"`
	StoreTel        string    `xorm:"" json:"store_tel" form:"store_tel" mapstructure:"store_tel"`
	GatherUrl       string    `xorm:"" json:"gather_url" form:"gather_url" mapstructure:"gather_url"`
	Dz              int       `xorm:"" json:"dz" form:"dz" mapstructure:"dz"`
	Zf              int       `xorm:"" json:"zf" form:"zf" mapstructure:"zf"`
	SubMchId        string    `xorm:"" json:"sub_mch_id" form:"sub_mch_id" mapstructure:"sub_mch_id"`
	IsFeel          int       `xorm:"" json:"is_feel" form:"is_feel" mapstructure:"is_feel"`
	TotalAmount     float32   `xorm:"" json:"total_amount" form:"total_amount" mapstructure:"total_amount"`
	Watch           int       `xorm:"" json:"watch" form:"watch" mapstructure:"watch"`
	WatchNumber     int       `xorm:"" json:"watch_number" form:"watch_number" mapstructure:"watch_number"`
	WatchTime       float32   `xorm:"" json:"watch_time" form:"watch_time" mapstructure:"watch_time"`
	BuyCount        int       `xorm:"" json:"buy_count" form:"buy_count" mapstructure:"buy_count"`
	MiniProgramCode string    `xorm:"" json:"mini_program_code" form:"mini_program_code" mapstructure:"mini_program_code"`
}
type ShortReq struct {
	*ShortVideo
	Pic []struct {
		Url   string `json:"url"`
		Thumb string `json:"thumb"`
		Type  string `json:"type"`
	} `json:"pic"`
	Video []struct {
		Url   string `json:"url"`
		Thumb string `json:"thumb"`
		Type  string `json:"type"`
	} `json:"video"`
}

type Shortvideo struct {
	Id            int
	UserId        int
	Type          int
	Title         string
	Pic           string
	Video         string
	BindType      int
	BindId        int
	Content       string
	Kouling       string
	StoreName     string
	StoreLocation string
	StoreTel      string
	GatherUrl     string
	Dz            int
	Zf            int
	SubMchId      string
	IsFeel        int
	TotalAmount   float32
	Watch         int
	VideoV2       []map[string]interface{} `xorm:"-"`
}
